<template>
	<view>
		<UserInfoCard></UserInfoCard>
		<!-- 缴费记录 -->
		缴费记录
		<view class='page-container'>
			<view v-for="(item,index) in dataSource">

			</view>
		</view>
		<LoadVue :load="load"></LoadVue>
	</view>
</template>

<script>
	import UserInfoCard from '../../../components/UserInfo/UserInfoCard.vue';
	import ButtonAllVue from '../../../components/Button/ButtonAll.vue';
	import {
		mapGetters
	} from 'vuex'
	import {
		dateFormat,
		getPastDate
	} from '../../../utils/assist';
	import {
		inHospitalPreparePayRecord
	} from '../../../api/inHospital';

	export default {
		components: {
			UserInfoCard,
			ButtonAllVue,
		},
		computed: {
			...mapGetters(["userInfo"]),
		},

		data() {
			return {
				isRecord: true,
				activeDate: '1m',
				selectedTimeRange: '请选择时间范围',
				//假设后端接口请求到的数据
				dataSource: [],
				dateFilters: [{
						label: '一月内',
						value: '1m'
					},
					{
						label: '半年内',
						value: '6m'
					},
					{
						label: '一年内',
						value: '1y'
					},
					// {
					// 	label: '全部',
					// 	value: 'all'
					// },
				],
				beginTime: '',
				endTime: '',
				load: false,
				form: {},
			}
		},
		onLoad(e) {
			if (e.item) {
				this.form = JSON.parse(e.item)
			}
			this.init()
		},
		mounted() {

		},
		methods: {
			init() {
				inHospitalPreparePayRecord({
					patId: this.form.patId,
					iptCount: this.form.iptCount
				}).then(res => {
					console.log(res)
				})
			},
			toPayPage(item) {
				uni.navigateTo({
					url: `/pages/Home/ServeHospital/InHospitalToPay?item=` + JSON.stringify(item)
				})
			},
			toListDetailPage(item) {
				uni.navigateTo({
					url: `/pages/Home/ServeHospital/InHospitalListDetail?item=` + JSON.stringify(item)
				})
			}

		}
	}
</script>

<style lang='scss' scoped>
	.page-container {
		/* background: linear-gradient(#e0f3ff 0%, #fff 30%); */
		/* min-height: 100vh; */
		padding: 0 16rpx;
	}

	.patientType-1 {
		background: rgb(153, 153, 153);
		padding: 3px 20px;
		border-radius: 45px 0 45px 0;
		color: white;
	}

	.patientType-2 {
		background: rgb(252, 80, 68);
		padding: 3px 20px;
		border-radius: 45px 0 45px 0;
		color: white;
	}

	.patientType-3 {
		background: #0cbd30;
		padding: 3px 20px;
		border-radius: 45px 0 45px 0;
		color: white;
	}

	.info-sheet {
		background: #fff;
		border-radius: 16rpx;
		margin: 25rpx 0 0 0;
		box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
		padding: 24rpx 32rpx 18rpx 32rpx;
	}

	.sheet-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 18rpx;
	}

	.title-container {
		position: relative;
	}

	.sheet-dept {
		font-size: 32rpx;
		color: #333;
		font-weight: bold;
	}

	.title-bg {
		position: absolute;
		width: 48rpx;
		height: 15rpx;
		background-color: rgba(65, 207, 230, 0.5);
		bottom: 0;
		left: calc(20%);
		z-index: 0;
	}

	.sheet-status {
		background: #4ad49a;
		color: #fff;
		font-size: 24rpx;
		border-radius: 8rpx;
		padding: 4rpx 18rpx;
		right: 8rpx;
	}

	.sheet-status.nobook {
		background: #eba242;
	}

	.sheet-status.booked {
		background: #bd4d4d;
	}

	.sheet-divider {
		height: 1rpx;
		border-top: 1rpx dashed #e0e0e0;
		margin: 18rpx 0 18rpx 0;
		width: 100%;
	}

	.sheet-row {
		display: flex;
		align-items: center;
		margin-bottom: 16rpx;
	}

	.label {
		color: #888;
		font-size: 28rpx;
		width: 160rpx;
	}

	.label.newchild {
		width: 170rpx;
	}

	.value {
		color: #333;
		font-size: 28rpx;
		flex: 1;
	}

	.vital {
		color: #ca3333;
	}

	.nav-btn {
		background: #e0f3ff;
		color: #1ec6e6;
		font-size: 22rpx;
		border-radius: 24rpx;
		padding: 0 18rpx;
		height: 40rpx;
		line-height: 40rpx;
		border: none;
		margin-left: 12rpx;
	}

	.sheet-btn-row {
		display: flex;
		justify-content: space-between;
		margin: 30rpx 0 15rpx;
	}

	.money-text {
		font-size: 32rpx;
		margin: 8rpx 100rpx 0 0;
	}

	.line-btn {
		width: 48%;
		height: 64rpx;
		background: #fff;
		color: #1ec6e6;
		font-size: 28rpx;
		border-radius: 44rpx;
		border: 1rpx solid #1ec6e6;
		text-align: center;
		line-height: 64rpx;
	}

	.cover-btn {
		width: 48%;
		height: 64rpx;
		background: linear-gradient(90deg, #6ed6f7 0%, #3ec6e7 100%);
		color: #fff;
		font-size: 28rpx;
		border-radius: 44rpx;
		text-align: center;
		line-height: 64rpx;
		border: none;
	}
</style>